package com.jiarong.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author 加绒
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class User {
    /**
     * 用户名
     **/
    private String username;

    /**
     * 年龄
     **/
    private int age;

    /**
     * <p>日期</p>
     * <p>@DateTimeFormat注解设置入参格式</p>
     * <p>@JsonFormat注解设置出参格式</p>
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date birthday;
}
